package com.itqf.service.impl;

import com.itqf.dao.ProductDao;
import com.itqf.service.ProductService;

/**
 * @Description:
 * @Company: 千锋互联
 * @Author: 李丽婷
 * @Date: 2020/9/27
 * @Time: 上午11:46
 */
public class ProductServiceImpl implements ProductService {
    //ProductDao dao = new ProductDaoImpl();  强偶尔，不利于后期的维护

    //解耦的写法
    ProductDao productDao ;//null

    public void setProductDao(ProductDao productDao) {
        System.out.println("spring容器通过setXXX方法赋值......");
        this.productDao = productDao;
    }

    @Override
    public void addProduct() {
        productDao.insert();
    }

    public  void  destory(){
        System.out.println("对象销毁");
    }
}
